home *** CD-ROM | disk | FTP | other *** search
- function Remove_Activate()
- {
- LoadScriptFile("idScriptUtil", "util.js");
- LoadScriptFile("idScriptBplate", "bplate.js");
- InitBoilerPlateClass();
- g_docAll.idTrHeadMargin_Remove.style.display = 'block';
- g_docAll.idTrHead_Remove.style.display = 'block';
- g_docAll.idTrBody_Remove.style.display = 'block';
- if (g_bIsAlpha)
- {
- g_docAll.idTrFoot_Remove.style.display = 'block';
- g_docAll.idChkRemoveForcex86.attachEvent("onclick", new Function ("idCtlAppsDso.Forcex86 = idChkRemoveForcex86.checked"));
- }
- if (false == g_bRemovePageLoaded)
- {
- if (Dso_IsRestricted("NoSupportInfo"))
- g_bShowSupportInfo = false;
- g_docAll.idSelSortBy.onchange = _SortDataSource;
- g_docAll.idRemoveListbox.dataSource = "idCtlAppsDso.Remove";
- Dso_GetCtl("Remove").attachEvent("ondatasetcomplete", Remove_OnDatasetComplete);
- g_docAll.idRemoveListbox.Refresh();
- g_bRemovePageLoaded = true;
- }
- g_bReenumAddList = false;
- Remove_SetFocus();
- }
- function Remove_SetFocus()
- {
- g_docAll.idRemoveListbox.focus();
- }
- function Remove_Deactivate()
- {
- g_docAll.idTrHeadMargin_Remove.style.display = 'none';
- g_docAll.idTrHead_Remove.style.display = 'none';
- g_docAll.idTrFoot_Remove.style.display = 'none';
- g_docAll.idTrBody_Remove.style.display = 'none';
- if (g_bReenumAddList)
- {
- Dso_Refresh("Add");
- }
- }
- function Remove_OnSetFocus()
- {
- var evt = window.event;
- ApplyExtraStyles(evt.srcChild, evt.bFocus);
- }
- function Remove_OnCustomDraw()
- {
- var evt = window.event;
- var tblElem = evt.srcChild;
- if (evt.bSelected)
- {
- var dwCapability = evt.Recordset("capability");
- if ('prepaint' == evt.drawStage)
- {
- if (dwCapability & APPCAP_MODIFYREMOVE)
- {
- evt.srcElement.EnableTemplate('idTrMultiBtns', false);
- evt.srcElement.EnableTemplate('idTrSingleBtns', true);
- }
- else
- {
- evt.srcElement.EnableTemplate('idTrMultiBtns', true);
- evt.srcElement.EnableTemplate('idTrSingleBtns', false);
- }
- }
- else
- {
- var bplate = new BoilerPlate();
- bplate.Parse(evt.Recordset("supportinfo"));
- if (!g_bShowSupportInfo ||
- !(dwCapability & APPCAP_REPAIR) &&
- (1 > bplate.Length() ||
- 1 == bplate.Length() && null != bplate.Get("displayname")))
- {
- tblElem.all('idTdInfoDesc').style.visibility = 'hidden';
- }
- if (dwCapability & APPCAP_MODIFYREMOVE)
- {
- tblElem.all('idBtnBoth').onclick = _ModifyOrRemove;
- if ( !(dwCapability & APPCAP_UNINSTALL) )
- tblElem.all('idBtnBoth').disabled = true;
- }
- else
- {
- tblElem.all('idBtnModify').onclick = _ModifyOrRemove;
- tblElem.all('idBtnRemove').onclick = _ModifyOrRemove;
- if ( !(dwCapability & APPCAP_MODIFY) )
- tblElem.all('idBtnModify').disabled = true;
- if ( !(dwCapability & APPCAP_UNINSTALL) )
- tblElem.all('idBtnRemove').disabled = true;
- }
- var szSort = g_docAll.idSelSortBy.options(g_docAll.idSelSortBy.selectedIndex).value;
- if ("displayname" == szSort || "size" == szSort || "timesused" == szSort)
- {
- var spnValue = evt.srcRow.all("idSpnIndexValue");
- var tdValue = spnValue.parentElement;
- var tdId = ("timesused" == szSort ? "idAFrequency" : "idASize");
- tdValue._szInner = tdValue.innerHTML;
- if (tdValue.innerText != "")
- {
- tdValue.innerHTML =
- "<SPAN id=" +
- tdId +
- " class='FakeAnchor' tabIndex=0 onKeyDown='_OnKeyDownFakeAnchor()' onClick='_OpenDefinition();'> " +
- " <U>" +
- tdValue._szInner +
- "</U></SPAN>";
- }
- }
- ApplyExtraStyles(tblElem, evt.bFocus);
- }
- }
- else
- {
- if ('prepaint' == evt.drawStage)
- {
- var spnValue = evt.srcRow.all("idSpnIndexValue");
- var tdValue = spnValue.parentElement.parentElement.parentElement;
- if (null != tdValue._szInner)
- {
- tdValue.innerHTML = tdValue._szInner;
- tdValue._szInner = null;
- }
- ApplyExtraStyles(tblElem, false);
- }
- }
- }
- function _OpenSupportInfo()
- {
- var szFeatures = g_szSupportInfoSize + "; resizable:no; help:no";
- window.showModalDialog("support.htm", window, szFeatures);
- window.event.returnValue = false;
- window.event.cancelBubble = true;
- }
- function _OpenDefinition()
- {
- var elemSrc = window.event.srcElement;
- if (("idSpnIndexValue" == elemSrc.id) && ("" != elemSrc.parentElement.parentElement.id))
- {
- elemSrc = elemSrc.parentElement.parentElement;
- }
- if ("" == elemSrc.id)
- {
- elemSrc = elemSrc.parentElement;
- }
- if ("idAFrequency" == elemSrc.id)
- {
- var szFeatures = "dialogWidth:20em; dialogHeight:16em; resizable:no; help:no";
- window.showModalDialog("def_freq.htm", window, szFeatures);
- }
- else if ("idASize" == elemSrc.id || "idSpnIndexValue" == elemSrc.id)
- {
- var szFeatures = "dialogWidth:20em; dialogHeight:10.7em; resizable:no; help:no";
- window.showModalDialog("def_size.htm", window, szFeatures);
- }
- window.event.returnValue = false;
- window.event.cancelBubble = true;
- }
- function _SortDataSource()
- {
- var selElem = window.event.srcElement;
- var optCur = selElem.options(selElem.selectedIndex);
- Dso_Sort("Remove", optCur.value);
- }
- function _ModifyOrRemove()
- {
- var rsCur = Dso_GetRecordset("Remove");
- var nRec = rsCur.AbsolutePosition;
- switch(event.srcElement.id)
- {
- case "idBtnBoth":
- g_docAll.idCtlAppsDso.Exec("Remove", "uninstall", nRec);
- break;
- case "idBtnModify":
- g_docAll.idCtlAppsDso.Exec("Remove", "modify", nRec);
- break;
- case "idBtnRemove":
- g_docAll.idCtlAppsDso.Exec("Remove", "uninstall", nRec);
- break;
- }
- if ("idBtnRemove" == event.srcElement.id)
- {
- g_bReenumAddList = true;
- }
- }
- function SupportInfo_Repair(nRecordNumber)
- {
- var rsCur = Dso_GetRecordset("Remove");
- var nRecordSav = rsCur.AbsolutePosition;
- window.focus();
- rsCur.AbsolutePosition = nRecordNumber;
- g_docAll.idCtlAppsDso.Exec("Remove", "repair", nRecordNumber);
- rsCur.AbsolutePosition = nRecordSav;
- }
- function SupportInfo_Query()
- {
- var rsCur = Dso_GetRecordset("Remove");
- var szRecord = "<recordnumber " + rsCur.AbsolutePosition + ">";
- szRecord += rsCur("supportinfo");
- szRecord += "<capability " + rsCur("capability") + ">";
- return szRecord;
- }
- function SupportInfo_GetDlgSize()
- {
- return g_szSupportInfoSize;
- }
- function Remove_OnDatasetComplete()
- {
- if (window.event.qualifier == "Remove")
- {
- var L_RemoveNoneAvailable_Text = "There are no programs installed on this computer";
- Dso_FeedbackIfEmpty("Remove", g_docAll.idRemoveListbox, L_RemoveNoneAvailable_Text);
- }
- }
-